package it.unipd.fbaron.mind_reader_squared.activities;

import it.unipd.fbaron.mind_reader_squared.R;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;

public class M3Activity extends BaseActivity {

	private EditText edit_text;
	private ImageButton speak_button;
	
	@Override
	public void onDestroy() {
		super.onDestroy();
	}

	@Override
	public void onPause() {
		super.onDestroy();
	}
	
	@Override
	public void onResume() {
		super.onResume();
	}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.m3_layout);
		
		edit_text = (EditText) findViewById(R.id.m3_edit_text);
		speak_button = (ImageButton) findViewById(R.id.m3_speak_button);
		
		//Force show soft keyboard
		InputMethodManager imm = (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); 
		imm.showSoftInput(edit_text, InputMethodManager.SHOW_FORCED);
		
		//Speak button listener
		speak_button.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				readText(edit_text.getText().toString(), 0);
			}
		});
	}

}